/* macOS 风格动画效果 */

/* 弹跳动画 - 用于 Dock 图标 */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.bounce {
  animation: bounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 放大缩小动画 - 用于窗口最小化/恢复 */
@keyframes scale-in {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scale-out {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.8);
    opacity: 0;
  }
}

.scale-in {
  animation: scale-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-out {
  animation: scale-out 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 淡入淡出 */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.fade-in {
  animation: fade-in 0.3s ease;
}

.fade-out {
  animation: fade-out 0.3s ease;
}

/* 从底部滑入 - 用于通知 */
@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-up {
  animation: slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 从右侧滑入 - 用于侧边栏 */
@keyframes slide-in-right {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slide-in-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 抖动动画 - 用于错误提示 */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.5s ease;
}

/* 脉冲动画 - 用于吸引注意力 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.pulse {
  animation: pulse 2s ease infinite;
}

/* 旋转加载动画 */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* Genie 效果 - macOS 经典最小化动画 */
@keyframes genie-minimize {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(0.1) translateY(100vh) translateX(0);
    opacity: 0;
  }
}

@keyframes genie-restore {
  0% {
    transform: scale(0.1) translateY(100vh);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.genie-minimize {
  animation: genie-minimize 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.genie-restore {
  animation: genie-restore 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 呼吸光效 */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0, 122, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 122, 255, 0.8);
  }
}

.glow {
  animation: glow 2s ease infinite;
}

/* 涟漪效果 */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  animation: ripple 0.6s ease-out;
}

/* 弹性缩放 */
@keyframes elastic-scale {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  75% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.elastic-scale {
  animation: elastic-scale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 平滑过渡类 */
.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-transform {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-opacity {
  transition: opacity 0.3s ease;
}

.transition-colors {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* macOS 专用缓动函数 */
.ease-macos {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.ease-macos-in {
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.ease-macos-out {
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

